"""
Author: wenbin
Create: 2024-08-16
"""

from flask import Blueprint, Flask

from app.api.v1 import app_view
from app.libs import injector


def register_blueprint(app: Flask) -> None:
    """
    注册蓝图

    :param app: Flask 实例
    """
    bp = Blueprint("v1", __name__, url_prefix="/v1")

    # 蓝图上注册路由
    app_view.router.register(bp, instance=injector.get(app_view.AppView))
    app.register_blueprint(bp)
